#include <iostream>

using namespace std;

int main(){
	int n,a,b;
	cin >> n >> a >> b;
	b += 1;
	a = n - a;
	cout << min(a,b) << endl;
	return 0;
}
